package com.qdlc.p2p.dal.model;

import java.util.Date;

import org.springframework.beans.BeanUtils;

import com.qdlc.p2p.common.util.DataUtils;
import com.qdlc.p2p.dal.dto.AdditionalUserCard;

public class AdditionalUserCardModel extends AdditionalUserCard {

	/**
	 * 搜索框输入字符串
	 */
	private String searchName;

	/**
	 * 获取开始时间
	 */
	private String startTime;

	/**
	 * 获取结束时间
	 */
	private String endTime;

	/**
	 * 获取使用开始时间
	 */
	private String useStartTime;

	/**
	 * 获取使用结束时间
	 */
	private String useEndTime;

	/**
	 * 获取开始时间
	 */
	private Date startDate;

	/**
	 * 获取结束时间
	 */
	private Date endDate;

	/**
	 * 获取使用开始时间
	 */
	private Date useStartDate;

	/**
	 * 获取使用结束时间
	 */
	private Date useEndDate;

	/**
	 * 当前页
	 */
	private int page;

	/**
	 * 每页记录数
	 */
	private int rows;

	/**
	 * 类型描述
	 */
	private String typeStr;

	/**
	 * 用户名称
	 */
	private String userName;

	/**
	 * 剩余天数
	 */
	private int remainDays;

	/**
	 * 所属卡片规则id
	 */
	private Long cardRuleId;

	/**
	 * 状态描述
	 */
	private String statusStr;

	public String getSearchName() {
		return searchName;
	}

	public void setSearchName(String searchName) {
		this.searchName = searchName;
	}

	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
		this.startDate = DataUtils.toDate(startTime);
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
		this.endDate = DataUtils.toDate(endTime);
	}

	public String getUseStartTime() {
		return useStartTime;
	}

	public void setUseStartTime(String useStartTime) {
		this.useStartTime = useStartTime;
		this.useStartDate = DataUtils.toDate(useStartTime);
	}

	public String getUseEndTime() {
		return useEndTime;
	}

	public void setUseEndTime(String useEndTime) {
		this.useEndTime = useEndTime;
		this.useEndDate = DataUtils.toDate(useEndTime);
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public Date getUseStartDate() {
		return useStartDate;
	}

	public void setUseStartDate(Date useStartDate) {
		this.useStartDate = useStartDate;
	}

	public Date getUseEndDate() {
		return useEndDate;
	}

	public void setUseEndDate(Date useEndDate) {
		this.useEndDate = useEndDate;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRows() {
		return rows;
	}

	public void setRows(int rows) {
		this.rows = rows;
	}

	public void setTypeStr(String typeStr) {
		this.typeStr = typeStr;
	}

	public String getTypeStr() {
		return typeStr;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public int getRemainDays() {
		return remainDays;
	}

	public void setRemainDays(int remainDays) {
		this.remainDays = remainDays;
	}

	public Long getCardRuleId() {
		return cardRuleId;
	}

	public void setCardRuleId(Long cardRuleId) {
		this.cardRuleId = cardRuleId;
	}

	public String getStatusStr() {
		return statusStr;
	}

	public void setStatusStr(String statusStr) {
		this.statusStr = statusStr;
	}

	/**
	 * AdditionalUserCardModel
	 *
	 * @param userCard
	 * @return AdditionalUserCardModel
	 * @author Kaiju Zhao
	 */
	public static AdditionalUserCardModel instance(AdditionalUserCard userCard) {
		AdditionalUserCardModel model = new AdditionalUserCardModel();
		BeanUtils.copyProperties(userCard, model);
		return model;
	}

	/**
	 * 根据Model返回实体原型
	 *
	 * @param model
	 * @return AdditionalUserCard
	 * @author Kaiju Zhao
	 */
	public static AdditionalUserCard prototype(AdditionalUserCardModel model) {
		AdditionalUserCard userCard = new AdditionalUserCard();
		BeanUtils.copyProperties(model, userCard);
		return userCard;
	}

}
